/**
 *
 * Created by shenzaifang on 2019-06-20
 */
import {saveValidate} from 'src/hrpub/common/utils/utils';
function getLangCode() {
    // SetCookie('langCode', 'simpchn')
    return getCookie('langCode') || 'simpchn';
    // return 'english'
    // return 'tradchn'
}

function getCookie(name) {
    //匹配字段
    var arr,
        reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');

    if ((arr = document.cookie.match(reg))) {
        return arr[2];
    } else {
        return null;
    }
}

/**
 * 本地调试添加黑色背景
 */
function addBlackStyle() {
    document.querySelector('body').classList.add('workbench-black', 'nc-lightapp-front-black');
    let a1 = document.createElement('link');
    a1.href = '/nccloud/resources/platform/nc-lightapp-front/nc-lightapp-front-black.css';
    a1.rel = "stylesheet";
    document.querySelector('head').appendChild(a1);
    document.querySelector('body').classList.remove('nc-no-theme')
}

export {
    getLangCode,
    addBlackStyle,
    saveValidate,
}
